// 该文件请求参数的封装
import { GET, POST, PATH } from "./config"
import axios from "axios"

const instance = axios.create({
    baseURL: "http://api.kudesoft.cn"  //发送请求
})

// 参数1.get post 2.路径 3.参数
export function obj(methods, url, params) {
    // 判断是什么方式请求
    switch (methods) {
        case GET:
            return get(url, params)
        case POST:
            return post(url, params)
    }
}

function get (url,params){
    return instance.get(url,params)
}
function post (url,params){
    return instance.post(url,params)
}
